/*
 * @Description:汽车类的测试类
 * 
 * @Author: rendc
 * 
 * @Date: 2025-07-29 14:13:29
 * 
 * @LastEditors: rendc
 * 
 * @LastEditTime: 2025-07-29 14:32:16
 */

public class Test04 {

  public static void main(String[] args) {
    // 实例化对象 - 无参构造器
    Car car1 = new Car();
    // 没有封装
    // car1.color = "红色";
    // 有封装
    car1.setColor("红色");
    car1.setBrand("丰田");
    car1.setPrice(100000.0);
    // 调用方法 输出属性信息
    car1.show();
    car1.forward();
    car1.turn("Left");
    // 实例化对象 - 全参构造器
    Car car2 = new Car("海湾蓝", "小米", 230000.0);
    car2.show();
    car2.backOff();
    car2.turn("Right");
    car2.turn("左转");
  }
}